package HomeWork2;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.Period;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;

//2.控制台输入5个人的出生日期，计算各自来到这个世界多少天，
//将结果存储到ArrayList，并打印ArrayList
public class d0325HomeWork2 {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<String> myList = new ArrayList<String>();
        for (int i = 0; i < 5; i++) {
            String str = sc.next();
            myList.add(i, str);

        }
        for (int i = 0; i < 5; i++) {
            LocalDate date1= LocalDate.parse(myList.get(i));
            LocalDate date2=LocalDate.now();
            Period next=Period.between(date1,date2);//between()方法获取两个日期之间的差作为Period 对象返回
            long a=date2.toEpochDay()-date1.toEpochDay();//日期的大纪元日
            System.out.print("来到世界"+a+"天   ");System.out.print(myList.get(i));
            System.out.println();


    }
}}